#include <iostream>
using namespace std;

int jie(int n) {
    if (n == 1) {
        return 1;
    }
    return n * jie(n - 1);
}

int main() {
    int n = 0;
    cin >> n;
    if (cin.peek() != '\n') {
        cout << "输入错误" << endl;
    }

    else if (n < 0) {
        cout << "输入错误" << endl;
    }

    else {
        cout << jie(n) << endl;
    }
    return 0;
}